﻿@model Lucene.ViewModels.LuceneSettingsPartEditViewModel

@using System.Linq

<fieldset>
    <legend>@T("Lucene Settings")</legend>
    @if (!Model.LuceneAnalyzerSelectorMappings.Any()) {
        @T("There is currently no mapping. Create an index first.")
    }
    else {
        <ul>
            @for (int i = 0; i < Model.LuceneAnalyzerSelectorMappings.Length; i++) {
                <li>
                    @Html.HiddenFor(m => Model.LuceneAnalyzerSelectorMappings[i].IndexName)
                    @Html.LabelFor(m => Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName, T("Analyzer name for the \"{0}\" index", Model.LuceneAnalyzerSelectorMappings[i].IndexName))
                    @Html.DropDownListFor(m => Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName, new SelectList(
                        Model.LuceneAnalyzerSelectors,
                        "Text",
                        "Value",
                        Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName
                    ))
                </li>
            }
        </ul>
    }
</fieldset>